<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title>XLib - js - core</title>
<script type="text/javascript" src="core.js"></script>
</head>

<body>
  <!--<textarea id="d" cols="100" rows="20"></textarea>
  <textarea id="x" cols="100" rows="20"></textarea>-->
  <div id="tt"></div>
  <button id="btn">test</button>
<script type="text/javascript">
var count = 0;
function a(name){
  XLib.DOM.$E("tt").innerHTML += (this.tagName) + "&nbsp;-&nbsp;" + count + " - " + XLib.Event.eventListenerList.length + "<br />";
  XLib.Event.removeEventListener("btn", "click", a, ["carl"], false);
  count++;
}
function b(name){
  XLib.DOM.$E("tt").innerHTML += (name) + "&nbsp;-&nbsp;" + count + " - " + XLib.Event.eventListenerList.length + "<br />";
  count++;
}
function c(name){
  XLib.DOM.$E("tt").innerHTML += (name) + "&nbsp;-&nbsp;" + count + " - " + XLib.Event.eventListenerList.length + "<br />";
  count++;
}
XLib.Event.addEventListener("btn", "click", a, ["carl"], false);
XLib.Event.addEventListener("btn", "click", b, ["carl"], false);
XLib.Event.once("btn", "click", c, ["once"], false);
/*
var _xml = new XLib.XML();
var xmlDoc = _xml.load("data.xml");
var json = XLib.JSON.xml2json(xmlDoc);
XLib.DOM.$E("d").value = XLib.JSON.json2string(json);
XLib.DOM.$E("x").value = XLib.JSON.json2xml(json);

function t(response)
{
  alert(response.status)
}
var req = new XLib.Ajax();
req.sendRequest({
  url : "slide.xml",
  method : "POST",
  param : "name=carlli&age=26",
  isXML : true,
  handler : t,
  args :  []
});*/

var o = {
  str:"string A",
  a : 1312312,
  b : undefined,
  c : null,
  d : function(){
      var i = 0;
      var u = "name";
      alert(u + i);
  },
  io : {
      instr : "string B",
      y : true,
      pp : {
          h : null,
          ic : false,
          fn : function(){
              XLib.DOM.$E("tt").innerHTML += (this.tagName) + "&nbsp;-&nbsp;" + count + " - " + XLib.Event.eventListenerList.length + "<br />";
              XLib.Event.removeEventListener("btn", "click", a, ["carl"], false);
              count++;
          }
      }
  },
  qs : [
      1, 
      2, 
      "siiiiii", 
      true, 
      undefined, 
      NaN,
      {
          version : "1.0.0.1",
          mode : 78,
          open : true,
          fn : function(){
              var req = new XLib.Ajax();
              req.sendRequest({
                url : "slide.xml",
                method : "POST",
                param : "name=carlli&age=26",
                isXML : true,
                handler : t,
                args :  []
              });
          },
          items : [
              {id:123, name:"n1"},
              {id:32423, name:"n2"},
              {id:23433, name:"n3"},
              {id:76878, name:"n4"},
              {
                  id:999, name:"n5", f1:function(){
                      var i = 10;
                      var arg = [];
                      var m = "OK";
                      document.title = m;
                      alert("i = " +                   i);
                  }
              }
          ]
      }
  ]
}

var i = null;
alert(o.toString())
eval("i = " + o.toString())
alert(i.a)
</script>
</body>
</html>
